import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router);


export const constantRoutes = [
    {
        path: '/dataGrid',
        name: 'dataGrid',
        component: () => import('./components/DataGridTemple'),
        meta: {title: '表格', icon: 'el-icon-menu', index: '1'}
    },
    {
        path: '/formTemple',
        name: 'FormTemple',
        meta: {title: '表单相关', icon: 'el-icon-menu', index: '2'},
        component: () => import('./components/FormTemple/FormList'),
        children: [
            {
                path: '/formList',
                name: 'FormList',
                component: () => import('./components/FormTemple/FormList/index'),
                meta: {title: '表单1', icon: 'el-icon-s-grid', index: '2-1'}
            },
        ]
    },
    {
        path: '/PageDemo/:id',
        name: 'text',
        component: () => import('./components/PageDemo/PageDemo'),
        meta: {title: '页面相关', icon: 'el-icon-s-grid', index: '3'},
        children: [

            {
                path: '/PageDemo',
                name: 'PageDemo2',
                component: () => import('./components/PageDemo/PageDemo'),
                meta: {title: '表单1', icon: 'el-icon-s-grid', index: '3-1'}
            },
        ]
    },
]

export default new Router({
    // mode: 'history',
    base: process.env.BASE_URL,
    routes: constantRoutes
})
